package cn.zqy.demo2.day06.ThreadGetAndSetName;

public class Demo02MyThread extends Thread{
    public Demo02MyThread() {

    }
    public Demo02MyThread(String name) {
        //把线程名称传递给父类,让父类(Thread)给子线程起一个名字
        super(name);
    }

    @Override
    public void run(){
        // 打印线程的名字
        System.out.println(Thread.currentThread().getName());
    }
}
